package org.darkforest.enums;

/**
 * Created by valentina on 15/3/19.
 */
public enum AjaxAlbumTypeEnum {
    IMAGE("img")
    ,EDITOR("editor")
    ,MOBILE("mb_img")
    ,GALLERY("gallery");

    private String text;
    public String getText() {
        return text;
    }
    public void setText(String text) {
        this.text = text;
    }

    private AjaxAlbumTypeEnum(String text) {
        this.text = text;
    }

    public static AjaxAlbumTypeEnum getAlbumType(String text){
        AjaxAlbumTypeEnum ajaxAlbumTypeEnum = null;
        for(AjaxAlbumTypeEnum typeEnum : AjaxAlbumTypeEnum.values()){
            if(text!=null && typeEnum.getText().equals(text)){
                ajaxAlbumTypeEnum = typeEnum;
            }
        }
        return ajaxAlbumTypeEnum;
    }
}
